<template>
	<scroll-view scroll-y class="cate-ul clearfix">
		<view class="cate-li" v-for="(item, index) in cate_list" :key="index" @click="goPage('/pages/cate/cateGoods?id=' + item.id + '&name=' + item.title)">
			<image :src="item.images" mode="aspectFit" class="cate-img"></image>
			<view class="cate-tit">{{ item.title }}</view>
		</view>
	</scroll-view>
</template>

<script>
export default {
	data() {
		return {
			cate_list: []
		};
	},
	created() {
		this.getAllCate();
	},
	methods: {
		// 分类列表 getAllCategory
		getAllCate() {
			this.$u.api.getAllCate().then(({ data }) => {
				this.cate_list = data;
			});
		}
	}
};
</script>

<style lang="scss">
.cate-ul {
	height: calc(100vh - 100rpx);
	background-color: #ffffff;
	.cate-li {
		float: left;
		width: 33.3333%;
		text-align: center;
		margin-top: 50upx;
		.cate-img {
			width: 150upx;
			height: 150upx;
			border-radius: 8upx;
			display: inline-block;
		}
		.cate-tit {
			font-size: 28upx;
			color: #333;
			padding-top: 10upx;
		}
	}
}
</style>
